//创建新题的控制器JS
msqbapp.controller('xttjController',function ($scope,msqbService) {
    $scope.userId = 0;
    $scope.classifyId = 1;
    //创建新题的初始化函数
    $scope.xttjInit = function () {
        var arr = window.location.search.split('&');
            for (var i = 0;i<arr.length;i++){
                var strarr = arr[i].split('=');
                if(strarr[0]=='?userId'){
                    $scope.userId = strarr[1];
                }
                if(strarr[0]=='classifyId'){
                    $scope.classifyId = strarr[1];
                }
            }
        //得到最新题目列表
        msqbService.getNewTopic($scope.classifyId).success(function (resp) {
            if (resp.total>0){
                $scope.newTopicList = resp.rows;
            }else{
                $scope.newTopicList = [];
            }
        });
    };
    //具体题目
    $scope.getTopicItem=function (userId,topicId) {
        window.open("topicitem.html?userId="+userId+"&topicId="+topicId);
    }
});